From 34f6eacc70e1328f250e610ab36434fda659537f Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 5 Aug 2026 16:09:16 +0000 Subject: [PATCH] Add example query to HUMANS doc --- doc/src/tables/humans.m4 | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/doc/src/tables/humans.m4 b/doc/src/tables/humans.m4 index 22045e2..35ce4ec 100644 --- a/doc/src/tables/humans.m4 +++ b/doc/src/tables/humans.m4 @@ -30,15 +30,35 @@ HUMANS |HUMANS_summary| These are in addition to the observers that normally make the observations. -.. sidebar:: - - |OBS helpful| - The related |EVENTS| row must must be one that records the presence of other species; the |EVENTS| row with an |EVENTS.EID| value that matches the HUMANS row's |HUMANS.EID| value must have an |EVENTS|.\ |EVENTS.Behavior| value of ``sdb_other_species``. +The |OBS| view is useful when querying HUMANS. + +.. code-block:: sql + :caption: + Using OBS to provide a more complete picture of human encounters + + SELECT obs.wid, obs.type + , obs.eid + , obs.date + , obs.animid AS focal + , obs.commid + , obs.start + , obs.stop + , humans.researchers + , humans.nonresearchers + , obs.notes + , obs.event_notes + FROM obs + JOIN humans + ON (humans.eid = obs.eid) + WHERE obs.behavior = 'sdb_other_species' + ORDER BY obs.animid, obs.date, obs.start, obs.stop + , obs.eid; + .. contents:: :depth: 2 -- 2.34.1